<%--
  Created by IntelliJ IDEA.
  User: micro
  Date: 4/5/2019
  Time: 12:36 AM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0"></script>
    <style>
        #chartdiv{
            width: 300px;
            height:300px;
            margin:0px auto;
        }
    </style>
</head>
<body>
<div id="chartdiv">
    <h2>Android和iPhone占比</h2>
<canvas id="myChart"></canvas>
</div>
<script>
    var ctx = document.getElementById('myChart').getContext('2d');
    ctx.canvas.height = 100;
    ctx.canvas.width = 100;
    var myChart = new Chart(ctx, {
        type: 'pie',
        // The data for our dataset
        data: {
            labels: ['Android', 'iPhone', 'others'],
            datasets: [{
                backgroundColor:[
                    'rgba(255, 99, 132, 0.2)',
                    'rgba(54, 162, 235, 0.2)',
                    'rgba(255, 206, 86, 0.2)',
                ],
                data: [${androidCount},${iphoneCount},${count}]
            }]
        },

        // Configuration options go here
        options: {

        }
    });



</script>
proportion
</body>
</html>
